package swrsystem.user;

import org.dbpedia.lookup.Result;

import swrsystem.feedback.RATING;


public class SearchResult {
	
	private Result result;
	private String interest_cate; 
	private int rating = -1;
	
	
	public int getRating() {
		return rating;
	}

	public void setRating(int rating) {
		this.rating = rating;
	}

	public SearchResult(Result result, String interest_cate) {
		this.result = result;
		this.interest_cate = interest_cate;
	}
	
	public Result getResult() {
		return result;
	}
	public void setResult(Result result) {
		this.result = result;
	}
	public String getInterest_cate() {
		return interest_cate;
	}
	public void setInterest_cate(String interestCate) {
		interest_cate = interestCate;
	}
	
	public void print() {
			System.out.println("[Interest Cate]: " + this.getInterest_cate());
			Result r = this.getResult();
			System.out.println("[URI]: " + r.getURI());
			System.out.println("[Description]: " + r.getDescription());
			System.out.println("[Refcount]: " + r.getRefcount());
			
			String ratingStr = "";
			switch(this.getRating()) {
			case RATING.EXCELLENT: ratingStr = "*****"; break;
			case RATING.GOOD: ratingStr = "****"; break;
			case RATING.AVERAGE: ratingStr = "***"; break;
			case RATING.FAIR: ratingStr = "**"; break;
			case RATING.POOR: ratingStr = "*"; break;
			case RATING.NORATING: ratingStr = ""; break;
			}
			System.out.println("[Rating]: " + ratingStr);
	}
	
}
